/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package resultsWCRT.impl;

import node1.impl.Node1Impl;
import genArchi.AbstractTask;
import genArchi.impl.ComputeBoxImpl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import resultsWCRT.LocalTask;

import result.Results;
import resultsWCRT.ResultsWCRT;
import resultsWCRT.ResultsWCRTPackage;
import resultsWCRT.Scheduling;
import utils.UtilsModelInstance;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Results WCRT</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * </p>
 *
 * @generated
 */
public class ResultsWCRTImpl extends Node1Impl implements ResultsWCRT {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ResultsWCRTImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ResultsWCRTPackage.Literals.RESULTS_WCRT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public void compute() {

		/**/
		boolean ok = true;
		
		/**/
		for (AbstractTask t : this.tasks) {
			
			/**/
			if (((LocalTask)t).getScheduling() != Scheduling.SCHEDULABLE) {
				
				ok = false;
				break;
			}
		} // for
		
		if (ok) {
			UtilsModelInstance.createSchedulingResult(this, Results.SCHEDULABLE);
		}
		else {
			UtilsModelInstance.createSchedulingResult(this, Results.NON_SCHEDULABLE);
		}

	}

} //ResultsWCRTImpl
